package pl.umk.mat.fred.unicore.urc.storagemanagement.tree.nodes;

public class RootNode extends Node {

	private boolean storagesVisible;
	
	public RootNode() {
		storagesVisible = true;
	}

	public boolean areStoragesVisible() {
		return storagesVisible;
	}
	
	public void setStoragesVisible(boolean val) {
		storagesVisible = val;
	}
	
	public RootNode getRootNode(){
		return this;
	}
	
	public RootNode clone() {
		return this.clone(null);
	}
	
	@Override
	public RootNode clone(Node nodeParent) {
		RootNode rootNode = new RootNode();
		rootNode.setParent(rootNode);
		rootNode.setStoragesVisible(storagesVisible);
		for (Node n : this.getChildren()) {
			Node n2 = n.clone(rootNode);
			rootNode.add(n2);
		}
		return rootNode;
	}
}
